<?php

class FoodPlaces extends Illuminate\Database\Eloquent\Model {
    protected $table = "laskiga_FoodPlaces";
    protected $primaryKey = "food_place_id";
    
    public static function get_name($id) {
        $foodplace = FoodPlaces::find($id);
        return $foodplace->food_place_name;
    }
    public static function get_id($name) {
        $foodplace = FoodPlaces::where('food_place_name', '=', $name)->first();
        return $foodplace->food_place_id;
    }
    public static function get_all() {
        $columns = array(
            'food_place_id',
            'food_place_name',
            'food_place_description',
            'food_place_image_name',
            'updated_at'
        );
        $foodplaces = FoodPlaces::all($columns);
        return $foodplaces;
    }
}